#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main()
{

	pid_t pid = 0;
	int i = 0;

	pid = fork();
	if(pid == 0)
	{
		while(i < 5)
		{
			printf("child1 procee:%d\n",getpid());
			sleep(1);
			i = i + 1;
		}
		exit(0);

	}else if(pid < 0)
	{
		printf("fork error\n");
	}


	pid = fork();
	if(pid == 0)
	{
		while(i < 5)
		{
			printf("child2 procee:%d\n",getpid());
			sleep(1);
			i = i + 1;
		}
		exit(0);

	}else if(pid > 0)
	{
	  while(i < 5)
	  {
		printf("father process%d\n",getpid());
		sleep(1);
		i = i + 1;
	  }


	}else
	{
		printf("fork error\n");
	}


	return 0;
}


